package cn.kgc.ssm.controller;

import cn.kgc.ssm.entity.User;
import cn.kgc.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: mosin
 * @version: v1.0  2022/5/7
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("login")
    public  Object login(User user){
       return userService.login(user);
    }

    @RequestMapping("register")
    public  Object register(User user){
        return userService.register(user);
    }

    @RequestMapping("update")
    public  Object update(User user){
        return userService.updateUser(user);
    }

    @RequestMapping("delete")
    public  Object delete(Integer id){
        return userService.deleteUser(id);
    }


}
